<div class="span6">
    <form class="bs-docs-example" id="gallery_form" method="post" action="<?= site_url('galleries/submit') ?>" name="gallery_form">
        <fieldset>

            <input type="hidden" name="post_action" value="<?= $post_action;?>">
            <input type="hidden" name="gallery_id" value="<? if ($post_action == "EDIT") echo $gallery['id']; ?>">

            <legend><? if ($post_action == "EDIT") echo "Edit gallery"; else echo "New gallery" ?></legend>
            <label>Page Name</label> <input type="text" name="title"
                                             placeholder="Type something…" value="<?if($post_action == "EDIT") echo $gallery['title']?>" class="span5"> <span
                class="help-block">Internal Flat-cms page name.</span>
			
			<label>Page</label>
            <select name="page_id" id="page_id">
            <?foreach ($pages as $page) {?>
            <option value="<?=$page['id']?>" <?if($post_action == "EDIT" && $page['id'] == $article['page_id']) echo "selected = 'selected'"?>
            >
            <?=$page['name']?>
            </option>
            <?}?>
            </select>
            <label>Disabled input</label> <input class="input-xlarge"
                                                 id="disabledInput" type="text"
                                                 placeholder="Disabled input here…" disabled> <label
                class="checkbox"> <input type="checkbox">
                Check me out
            </label>
            <div class="form-actions">
                <button type="submit" id="submit_form" class="btn btn-primary">Save
                    changes</button>
                <a href="<?=site_url("galleries/view_all")?>" class="btn">Cancel</a>
            </div>
        </fieldset>
    </form>
</div>